Skip to content

Avoid using an unitialized variable #2194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

robertsipka
Copy link
Contributor

@robertsipka robertsipka commented Feb 2, 2018

@DanielBallaSZTE : This bug is appeared after your PR (#2191). Please check that this patch covers your original intent.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka [email protected]
@zherczeg
Copy link
Member

zherczeg commented Feb 2, 2018

I think the issue is not "avoiding an uninitialized variable", but the code was simply wrong. So please change the description. Also pleas add test case since it seems this is not tested.

@robertsipka
Copy link
Contributor Author

robertsipka commented Feb 2, 2018

I think both. The code was wrong, but it also allowed that if the first part of the condition is false then the uninitialized value of the code_unit is used. Besides that, I agree with you, I will rename it, and add test cases also.

@zherczeg
Copy link
Member

zherczeg commented Feb 6, 2018

Please add a test case. I think an eval should do it.

@robertsipka
Copy link
Contributor Author

@zherczeg : Sorry for the late response. I've looked over it and actually I do not know what to check that we have not checked yet. The jerry returns with SyntaxError in case of invalid unicode escape sequence, which is an expected behaviour. In #2191, a test case has already added which covers the #2180 and #2192 issues, but it was a wrong and a partial fix, the problem is still exist in some cases without this patch, e.g. the following input : JSON.parse('"' + '\\u23'); will cause the same issue in the current master. Should I add another test with the input above?

@robertsipka
Copy link
Contributor Author

#2201 also fixes this bug, so I am closing this PR.

@robertsipka robertsipka deleted the avoid_unitialized_variable branch October 27, 2021 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants